package cn.virens.web.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.virens.database.service.CacaheTest;
import cn.virens.util.RequestUtil;

@Controller
@RequestMapping("cache")
public class CacaheTestContorller {
	private @Resource CacaheTest cacaheTest;

	@ResponseBody
	@RequestMapping("put.json")
	public String put(HttpServletRequest request, HttpServletResponse response, Model model) {
		return cacaheTest.put("CacaheTestContorller", RequestUtil.getValueStr(request, "test"));
	}

	@ResponseBody
	@RequestMapping("get.json")
	public String get(HttpServletRequest request, HttpServletResponse response, Model model) {
		return cacaheTest.get("CacaheTestContorller");
	}
}
